import { post, get } from '@/http/axios'
export default {
    namespaced: true,
    state: {
        //   订单信息
        productOrderData: [],
        orderDataById:{},
        orderData_Tag:[],
    },
    mutations: {
        SET_PRODUCTORDER(state, data) {
            state.productOrderData = data
        },
        SET_ORDERDATABYID(state,data){
            state.orderDataById = data
        },
        SET_ORDER_TAG(state,data){
            state.orderData_Tag = data
        }
    },
    actions: {
        //获取订单信息
        async getProductOrderVuex({ commit }, param) {
            let res = await get('/order/pageQuery', param)
            // console.log(res.data.data.list)
            commit('SET_PRODUCTORDER', res.data.data.list)
        },
        // 按id查询订单信息
        async getOrderDataByIdVuex({ commit }, param) {
            let res = await get('/order/findById', param)
            // console.log(res.data.data.orderLines)
            commit('SET_ORDERDATABYID', res.data.data)
        },
        //导航栏全部专用订单信息
        async getOrder_Tag({ commit }, param){
            let res = await get('/order/pageQuery', param)
            // console.log(res.data.data.orderLines)
            commit('SET_ORDER_TAG', res.data.data.list)
        }
    }
}